<!--<?php
include_once PrintEot('left');
print <<<EOT
-->
<div class="nav3 mb10">
    <ul id="basictype" class="cc">
        <li><a href="$basename" hidefocus="true">楼盘管理</a></li>
		<li class="current"><a href="$basename&action=edit&hid=$hid" hidefocus="true">编辑楼盘</a></li>
    </ul>
</div>
<div class="nav4 mb10">
    <ul class="cc">
        <li><a href="$basename&action=edit&hid=$hid" hidefocus="true">基本信息</a></li>
		<li class="current"><a href="$basename&action=album&hid=$hid" hidefocus="true">相册</a></li>
		<li><a href="$basename&action=video&hid=$hid" hidefocus="true">视频</a></li>
		<li><a href="$basename&action=map&hid=$hid" hidefocus="true">地图</a></li>
		<li><a href="$basename&action=pricedetail&hid=$hid" hidefocus="true">价格明细</a></li>
		<li><a href="$basename&action=feed&hid=$hid" hidefocus="true">楼盘动态</a></li>
		<li><a href="$basename&action=colony&hid=$hid" hidefocus="true">关联业主小区</a></li>
		<li><a href="$basename&action=information&hid=$hid" hidefocus="true">关联资讯</a></li>
		<li><a href="$basename&action=nav&hid=$hid" hidefocus="true">自定义导航</a></li>
		<li><a href="admin.php?adminjob=mode&admintype=house_groupbuy&hid=$hid" hidefocus="true">团购管理</a></li>
		<li><a href="admin.php?adminjob=mode&admintype=house_evaluation&hid=$hid&action=score" hidefocus="true">评价管理</a></li>
	</ul>
</div>
<!--
EOT;
if (empty($type)) {print <<<EOT
-->

<style>
.admin-img li{float:left;width:150px;height:210px;line-height:16px;}
.admin-img li img{width:100px;height:100px;display:block;margin:0 auto;padding:5px;border:1px solid #ccc;background:#fff;}
.height-limit{height:18px;overflow:hidden;line-height:18px}
</style>


<h2 class="h1"><span class="mr10 fl">相片管理</span><span class="fl linka mr10">
选择相册: 
<select class="select_wa" name="imagetype" onchange="window.location.href='$_basename&typeid='+this.value;">
	<option value="0"></option>
<!--
EOT;
foreach ($topTypes as $key => $top) {
$selected = $key==$typeid ? 'selected="selected"':'';
print <<<EOT
-->
    <option $selected value="$key">$top[name]</option>
<!--
EOT;
if($secendTypes[$key]){
foreach ($secendTypes[$key] as $k=>$secend) {
$selected = $k==$typeid ? 'selected="selected"':'';
print <<<EOT
-->
	<option $selected value="$k">&nbsp; &nbsp;|-$secend[name]</option>
<!--
EOT;
}}print <<<EOT
-->
<!--
EOT;
}print <<<EOT
-->
</select>
</span>

<a href="$_basename&type=upload" class="btn_add"><i>上传图片</i></a></h2>
<form action="$_basename" method="post">
<input type="hidden" name="type" value="deleteimages" >
<div class="mb10">
<ul class="admin-img tac cc" style="margin-top:5px">
<!--
EOT;
foreach ($images as $key => $image) {print <<<EOT
-->
		<li id="image_{$image[id]}">
			<a href="$image[url]" target="_blank">
				<img src="$image[mini]" border="0" class="vphoto" title="$image[name]"/>
			</a>
			<p id="typename_{$image[id]}"> 类型:$image[typename] </p>
			<p id="descrip_{$image[id]}" class="height-limit">&nbsp;$image[descrip]</p>
			<p>$image[uploadtime]</p>
			<p>
			<span class="mr10">
				<a href="#" onclick="editImage('$image[id]',this);return false;" >
					[编辑]
				</a>
			</span>
			<span class="mr10">
				<a href="#" onclick="delImage('$image[id]');return false;">
					[删除]
				</a>
			</span>
			</p>
			<p>选中 <input type="checkbox" name="select[]" value="$image[id]"></p>
		</li>
<!--
EOT;
}print <<<EOT
-->
</ul>
	
</div>
<div class="mt10 cc">$pages</div>
<div class="mb10 tac">
	<span class="bt"><span><button onfocus="blur();" onclick="selectAll('select[]')" type="button">全选</button></span></span>
	<span class="btn"><span><button type="submit" onfocus="blur();"  onclick="return confirm('是否确认该操作？')">删除</button></span></span>
</div>
</form>
<script src="js/pw_ajax.js" language="JavaScript"></script>
<script src="js/global.js" language="JavaScript"></script>
<script language="javascript">
function editImage(id,o) {
	var url = "$ajax_basename";
	read.obj = o;
	ajax.send(url,'type=editimage&id='+id,ajax.get);
}
function editImaged(id) {
	var rText = ajax.request.responseText.split("|");
	if (rText[0] == 'success') {
		var typename = document.getElementById('typename_'+id);
		typename.innerHTML = '类型: '+ rText[1];
		var descrip = document.getElementById('descrip_'+id);
		descrip.innerHTML = ' '+ rText[2];
	} else {
		ajax.guide();
	}
}
function delImage(id){
	if (!confirm("确定要删除此图片吗？")){
		return false;
	}
	var url = "$ajax_basename";
	ajax.send(url,'type=deleteimage&id='+id,function(){
		var rText = ajax.request.responseText.split("|");
		if (rText[0] == 'success') {
			var element = document.getElementById('image_'+id);
			if (element) {
				showDialog('success','操作成功!',1);
				element.parentNode.removeChild(element);
			} else {
			}
		} else {
			ajax.guide();
		}
	});
}

~
function () {
	var ischeck = 'checked';
	selectAll = function (name) {
		var temp = document.getElementsByName(name);
		if (temp.length < 1) return null;
		for (var i=0 ; i<temp.length;i++) {
			temp[i].checked = ischeck;
		}
		ischeck = ischeck ? false : 'checked';
	}
}()
</script>
<!--
EOT;
} elseif ($type=='upload') {print <<<EOT
-->
<script type="text/javascript" src="js/global.js"></script>
<script type="text/javascript" src="js/core/core.js"></script>
<script type="text/javascript" src="mode/house/js/flash.js"></script>
<script type="text/javascript" src="js/swfobject.js"></script>
<script type="text/javascript">
	swfobject.registerObject('mutiupload','10.0.0','js/expressInstall.swf',function(){
			setTimeout(function(){uploader.setAlbumId(getObj('aidsel_info').value);},300);
		});
</script>
<h2 class="h1 mb10">上传照片</h2>
<div id="content_main" >
	<div style="padding-left:20px;">
		<p><select name="aid" style="width:200px;" id="aidsel_info" onchange="uploader.setAlbumId(this.value);">
<!--
EOT;
foreach ($topTypes as $key => $top) {
print <<<EOT
-->
    <option value="$key">$top[name]</option>
<!--
EOT;
if($secendTypes[$key]){
foreach ($secendTypes[$key] as $k=>$secend) {
print <<<EOT
-->
	<option value="$k">&nbsp; &nbsp;|-$secend[name]</option>
<!--
EOT;
}}print <<<EOT
-->
<!--
EOT;
}print <<<EOT
-->
			</select></p>
<style>
.admin_table_d td{padding:5px 0 5px 10px;border-bottom:1px solid #dde9f5;}
.admin_table_d tr:hover td{background-color:#f4f8fc;}

/*flash upload*/
.g_photosbox{}
.g_photosbox td{padding:4px 0 4px 10px;height:18px;line-height:21px;} 
.g_photosbox .wname{display:none;}
.g_photosbox input{width:200px;}
.g_photosbox .updel{margin-top:4px;}
</style>
			<div id="viewimg" class="menu" style="display:none;"></div>
			<div class="g_photosbox">
				<object id="mutiupload" name="mutiupload" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="250" height="46">
				  <param name="movie" value="images/uploader.swf" />
				  <param name="FlashVars" value="url=$db_bbsurl%2Findex.php%3Fm%3Dhouse%26q%3Dupload%26hid%3D{$hid}%26uid%3D$uid%26verify%3D$swfhash"/>

				  <param name="allowScriptAccess" value="always" />
				  <param name="wmode" value="transparent" />
				  <!--[if !IE]>-->
				  <object type="application/x-shockwave-flash" data="images/uploader.swf" width="250" height="46" flashvars="url=$db_bbsurl%2Findex.php%3Fm%3Dhouse%26q%3Dupload%26hid%3D{$hid}%26uid%3D$uid%26verify%3D$swfhash"  allowscriptaccess="always">
				  <!--<![endif]-->
					<p>Alternative content</p>
				  <!--[if !IE]>-->
				  </object>

				  <!--<![endif]-->
				</object>
				<table><tr><td class="wname">文件名</td><td width="205">描述</td><td width="60">大小</td><td width="80">上传进度</td><td width="20">删</td></tr><tbody id="qlist"></tbody></table>
			</div>
			<div id="attsize" style="margin-top:10px"></div>
		</div>
	</div>
    </div>
</div>
<script language="JavaScript">
window.onReady(function() {
uploader.init();
uploader.maxLength = 10000;
uploader.baseurl = '$basename&action=album&hid=$hid';
});

</script>
<!--
EOT;
} elseif ($type=='upload1') {print <<<EOT
-->
<form action="$_basename" method="post" name="form" enctype="multipart/form-data">
<input type="hidden" name="step" value="2" >
<input type="hidden" name="type" value="upload" >
<table width="100%" cellspacing="0" cellpadding="0">
	<tbody>
	<tr>
	<td colspan="3">
<span class="fl fn mr10">
所属相册
<select class="select_wa" name="typeid">
<!--
EOT;
foreach ($topTypes as $key => $top) {print <<<EOT
-->
    <option value="$key">$top[name]</option>
<!--
EOT;
if($secendTypes[$key]){
foreach ($secendTypes[$key] as $k=>$secend) {
print <<<EOT
-->
	<option value="$k">&nbsp; &nbsp;|-$secend[name]</option>
<!--
EOT;
}}print <<<EOT
-->
<!--
EOT;
}print <<<EOT
-->
</select>
</span>
	</td>
	</tr>
	<tr>
		<td>上传图片</td>
		<td>
			<input id="uploadpic" type="file" name="uploadpic" onchange="checkFileType()">（允许类型: jpg，jpeg，gif，png）
			<span id="fileTypeError" style="display:none;"><font color="red">请选择正确的文件类型</font></span>
		</td>
	</tr>
	</tbody>
</table>

<div class="mb10 tac"><span class="btn2"><span><button type="submit" onfocus="blur();">提 交</button></span></span></div>
</form>
<script>
function checkFileType() {
	var fileName = getObj("uploadpic").value;
	if (fileName != '') {
		var regTest = /\.(jpe?g|gif|png)$/gi;
		var arrMactches = fileName.match(regTest);
		if (arrMactches == null) {
			getObj('fileTypeError').style.display = '';
			return false;
		} else {
			getObj('fileTypeError').style.display = 'none';
		}
	}
	return true;
}
</script>
<!--
EOT;
}include_once PrintEot('adminbottom');
?>-->